package com.learning.sims.utils;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * Created by xieyichao on 2017/4/22.
 */

public class SimsUtil {

    //0-8点为Sleep time
    public static boolean isSleepTime(long time){
        SimpleDateFormat sdr = new SimpleDateFormat("HH-mm-ss");
        String times = sdr.format(new Date(time * 1000L));
        int hour = Integer.parseInt(times.split("-")[0]);
        return hour >= 0 && hour <= 8 ? true:false;
    }

}
